﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B.S.Ingredients.Infartructrue.Interfaces
{
    /// <summary>
    /// 仓储接口
    /// </summary>
    /// <typeparam name="T">泛型</typeparam>
    public interface IBaseRepository<T>
    {
        /// <summary>
        /// 返回所有值
        /// </summary>
        /// <returns>集合</returns>
        IQueryable<T> GetAll();
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="t">实体</param>
        /// <returns>受影响行数</returns>
        Task<int> CreateAsync(T t);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="t">实体</param>
        /// <returns>受影响行数</returns>
        Task<int> UpdateAsync(List<T> t);

        Task<int> Update(T t);
    }
}
